﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'InsertDatosSalidaProducto')
	BEGIN
		DROP  Procedure  InsertDatosSalidaProducto
	END

GO

CREATE Procedure InsertDatosSalidaProducto

	(
		   @stockActual decimal(8,4),
           @IdBien int
	)


AS
BEGIN
SET NOCOUNT ON
	
	BEGIN TRY
UPDATE [dbo].[Bien] 
			SET [stockActual] = [stockActual] + @stockActual
			WHERE [IdBien]=@IdBien
	END TRY

    BEGIN CATCH
		EXEC RethrowError;
	END CATCH
    
    SET NOCOUNT OFF		
End

GO


GRANT EXEC ON InsertDatosSalidaProducto TO PUBLIC

GO
